home *** CD-ROM | disk | FTP | other *** search
- Path: grimsel.zurich.ibm.com!usenet
- From: wgk@zurich.ibm.com (Keith Whittingham)
- Newsgroups: comp.lang.c++
- Subject: Re: Is this a memory leak?
- Date: 5 Apr 1996 18:16:14 GMT
- Organization: IBM Research, ZRH
- Message-ID: <4k3o1e$13gt@grimsel.zurich.ibm.com>
- References: <4jv214$gv7@insosf1.netins.net> <4k0c2i$h6e@werple.net.au> <31655281.78CB@datalytics.com>
- Reply-To: wgk@zurich.ibm.com
- NNTP-Posting-Host: pine.zurich.ibm.com
- X-Newsreader: IBM NewsReader/2 v1.00
-
- In <31655281.78CB@datalytics.com>, Rob Stewart <stew@datalytics.com> writes:
- [snip]
- >There is also another question. Why is top allocated on the
- >heap? I realize this is a short excerpt of code to illustrate
- >something else, but this is a common thing. You should avoid
- >the heap whenever possible. A heap allocation involves fairly
- >lengthy operations, while a stack allocation involves a
- >subtraction. The result is higher performance.
-
- And more stack overflows!
-
- Personally I'd go for the lower performance, especially for code
- which is used by other people. I hate seeing > 4k of stack allocated
- for no good reason other than "It works that way".
-
- The idea of undeterminable stack overflows in C/C++ code running in
- nuclear power stations and jumbo jets scares the hell out of me.
-
- At least Java's got this sorted out
-
- Keith
-
-